package fr.miage.ageco.dataaccess.services;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import fr.miage.ageco.dataaccess.bo.Competence;
import fr.miage.ageco.dataaccess.mappers.CompetenceMapper;

@Service
@Transactional
public class CompetenceService {

	@Autowired
	private CompetenceMapper competenceMapper;
	
	@Transactional
	public Competence getCompetence(int id) {
		return competenceMapper.getCompetence(id);
	}
	
	@Transactional
	public List<Competence> getAllCompetences() {
		return competenceMapper.getAllCompetences();
	}
	
	@Transactional
	public List<Competence>  getCompetenceForEmploye(int id) {
		return competenceMapper.getCompetenceForEmploye(id);
	}
	
	@Transactional
	public int insertCompetence(Competence competence) {
		return competenceMapper.insertCompetence(competence);
	}
	
	@Transactional
	public int insertCompetenceForEmploye(int idCompetence, int idEmploye) {
		return competenceMapper.insertCompetenceForEmploye(idCompetence, idEmploye);
	}
	
	@Transactional
	public int updateCompetence(Competence competence) {
		return competenceMapper.updateCompetence(competence);
	}
	
	@Transactional
	public int deleteCompetence(Competence competence) {
		return competenceMapper.deleteCompetence(competence);
	}
	
	@Transactional
	public int deleteCompetenceForEmploye(int idCompetence, int idEmploye) {
		return competenceMapper.deleteCompetenceForEmploye(idCompetence,idEmploye);
	}
	
	
	
}
